<template>
	<view class="daylist">
		<view class="left">
			<image src="../../static/dangjian/list_icon.png" style="width: 72rpx; height:72rpx; margin-right: 20rpx">
			</image>
		</view>
		<view class="right">
			<view class="right_name">
				<text v-if="dayListObj.activityTheme">{{dayListObj.activityTheme}}</text>
				<text v-else>{{dayListObj.uploadName}}</text>
			</view>
			<view class="dj_dept_info" v-show="!isTongXun">
				<text class="dj_dept_name">
					<text v-if="dayListObj.djDeptName">{{dayListObj.djDeptName}}</text>
					<text v-else>{{djDeptName}}</text>
				</text>
				<text class="activity_name">
					<text v-if="dayListObj.activityType == 1">党员大会</text>
					<text v-if="dayListObj.activityType == 2">支部委员会</text>
					<text v-if="dayListObj.activityType == 3">党小组会</text>
					<text v-if="dayListObj.activityType == 4">党课</text>
					<text v-if="dayListObj.activityType == 5">党员统一活动日</text>
					<text v-if="dayListObj.activityType == 6">特色活动</text>
				</text>
			</view>
			<view class="right_uploadInfo" :style="!isTongXun?'border-top: 1px solid #EEEEEE':''">
				<text class="peo">上传人:{{dayListObj.uploadUser}}</text>
				<text class="time" :style="!isTongXun?'float: right;':''">{{uploadTime}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		newDate
	} from "../../utils/fun.js"
	export default {
		props: {
			dayListObj: {
				type: Object
			},
			isTongXun: {
				type: Boolean,
				default: true
			}
		},
		data() {
			return {
				uploadTime: '',
				fileName: "",
				djDeptName: ''
			};
		},
		created(options) {
			// let typeClassArr = JSON.parse(uni.getStorageSync('typeClassArr'))[this.dayListObj.activityType];

			this.fileName = JSON.parse(this.dayListObj.accessoryUrl)[0].accessoryName;
			if (this.isTongXun) {
				this.uploadTime = this.dayListObj.updateTime;
			} else {
				console.log(this.dayListObj.createTime);
				this.uploadTime = this.dayListObj.createTime;
				this.dayListObj.uploadUser = JSON.parse(uni.getStorageSync('loginUserInfo')).userName; // 上传人-当前登录人
				this.djDeptName = JSON.parse(uni.getStorageSync('loginUserInfo')).djDeptName; // 当前登录人所属支部
				// this.dayListObj.activityName = typeClassArr.name;
				// console.log(JSON.parse(uni.getStorageSync('typeClassArr')));
			};
		},

		methods: {},
	};
</script>

<style lang="scss">
	@import '@/static/common.scss';
	page {
		background: #F9F9F9;
	}

	.daylist {
		margin: 0 auto;
		margin-top: 24rpx;
		width: 702rpx;
		min-height: 140rpx;
		background: #FFFFFF;
		border-radius: 8rpx;
		display: flex;
		align-items: center;
		padding: 24rpx 30rpx;
		box-sizing: border-box;
		/* box-shadow: 4rpx 4rpx 6rpx rgba(15, 15, 15, 0.15); */
	}

	.left {
		flex: 1;
	}

	.right {
		flex: 9;
	}

	.right .right_name {
		width: 560rpx;
		color: #000000;
		font-size: 32rpx;
		font-weight: bold;
	}

	.right .peo {
		color: #000000;
		font-size: 24rpx;
		margin-right: 20rpx;
	}

	.right_uploadInfo {
		padding-top: 6rpx;
		margin-top: 20rpx;
	}

	.right_uploadInfo .time {
		font-size: 24rpx;
		color: #999999;
	}

	.dj_dept_info {
		margin: 10rpx 0;
	}

	.dj_dept_name,
	.activity_name {
		padding: 4rpx 8rpx;
		height: 36rpx;
		border-radius: 8rpx;
		font-size: 22rpx;
	}

	.dj_dept_name {
		width: 120rpx;
		background: $themeColor;
		color: #FFFFFF;
		margin-right: 20rpx;
	}

	.activity_name {
		width: 180rpx;
		border: 1px solid $themeColor;
		color: $themeColor;
	}
</style>
